package com.seeyon.apps.seepkk.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;

import com.seeyon.apps.seepkk.manager.QiangsSeepManager;
import com.seeyon.ctp.common.controller.BaseController;
import com.seeyon.ctp.util.json.JSONUtil;

/**
 * 
 *
 */
public class SeepController extends BaseController {
	
	private static Logger log = Logger.getLogger(SeepController.class); 

	private QiangsSeepManager qiangsSeepManager;

	public void setQiangsSeepManager(QiangsSeepManager qiangsSeepManager) {
		this.qiangsSeepManager = qiangsSeepManager;
	}

	public ModelAndView delBaseData(HttpServletRequest request, HttpServletResponse response) {
		try {
			request.setCharacterEncoding("utf-8");
			response.setContentType("application/json;charset=utf-8");
			String formId = request.getParameter("formId") == null 
					? "0" : request.getParameter("formId").toString();
			String records = request.getParameter("records").toString();
			
			String out = qiangsSeepManager.delBaseData(Long.valueOf(formId), Arrays.asList(records.split(",")));
			response.getWriter().print(out);
		}catch(Exception e){
		}
		return null;
	}
}
